/*
 * XML Type:  CreditCardStatementEndResponse
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.CreditCardStatementEndResponse
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML CreditCardStatementEndResponse(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class CreditCardStatementEndResponseImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements net.ofx.types.x2003.x04.CreditCardStatementEndResponse
{
    
    public CreditCardStatementEndResponseImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName CURDEF$0 = 
        new javax.xml.namespace.QName("", "CURDEF");
    private static final javax.xml.namespace.QName CCACCTFROM$2 = 
        new javax.xml.namespace.QName("", "CCACCTFROM");
    private static final javax.xml.namespace.QName CCCLOSING$4 = 
        new javax.xml.namespace.QName("", "CCCLOSING");
    
    
    /**
     * Gets the "CURDEF" element
     */
    public net.ofx.types.x2003.x04.CurrencyEnum.Enum getCURDEF()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CURDEF$0, 0);
            if (target == null)
            {
                return null;
            }
            return (net.ofx.types.x2003.x04.CurrencyEnum.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "CURDEF" element
     */
    public net.ofx.types.x2003.x04.CurrencyEnum xgetCURDEF()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.CurrencyEnum target = null;
            target = (net.ofx.types.x2003.x04.CurrencyEnum)get_store().find_element_user(CURDEF$0, 0);
            return target;
        }
    }
    
    /**
     * Sets the "CURDEF" element
     */
    public void setCURDEF(net.ofx.types.x2003.x04.CurrencyEnum.Enum curdef)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(CURDEF$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(CURDEF$0);
            }
            target.setEnumValue(curdef);
        }
    }
    
    /**
     * Sets (as xml) the "CURDEF" element
     */
    public void xsetCURDEF(net.ofx.types.x2003.x04.CurrencyEnum curdef)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.CurrencyEnum target = null;
            target = (net.ofx.types.x2003.x04.CurrencyEnum)get_store().find_element_user(CURDEF$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.CurrencyEnum)get_store().add_element_user(CURDEF$0);
            }
            target.set(curdef);
        }
    }
    
    /**
     * Gets the "CCACCTFROM" element
     */
    public net.ofx.types.x2003.x04.CreditCardAccount getCCACCTFROM()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.CreditCardAccount target = null;
            target = (net.ofx.types.x2003.x04.CreditCardAccount)get_store().find_element_user(CCACCTFROM$2, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "CCACCTFROM" element
     */
    public void setCCACCTFROM(net.ofx.types.x2003.x04.CreditCardAccount ccacctfrom)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.CreditCardAccount target = null;
            target = (net.ofx.types.x2003.x04.CreditCardAccount)get_store().find_element_user(CCACCTFROM$2, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.CreditCardAccount)get_store().add_element_user(CCACCTFROM$2);
            }
            target.set(ccacctfrom);
        }
    }
    
    /**
     * Appends and returns a new empty "CCACCTFROM" element
     */
    public net.ofx.types.x2003.x04.CreditCardAccount addNewCCACCTFROM()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.CreditCardAccount target = null;
            target = (net.ofx.types.x2003.x04.CreditCardAccount)get_store().add_element_user(CCACCTFROM$2);
            return target;
        }
    }
    
    /**
     * Gets array of all "CCCLOSING" elements
     */
    public net.ofx.types.x2003.x04.CreditCardClosing[] getCCCLOSINGArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(CCCLOSING$4, targetList);
            net.ofx.types.x2003.x04.CreditCardClosing[] result = new net.ofx.types.x2003.x04.CreditCardClosing[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "CCCLOSING" element
     */
    public net.ofx.types.x2003.x04.CreditCardClosing getCCCLOSINGArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.CreditCardClosing target = null;
            target = (net.ofx.types.x2003.x04.CreditCardClosing)get_store().find_element_user(CCCLOSING$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "CCCLOSING" element
     */
    public int sizeOfCCCLOSINGArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(CCCLOSING$4);
        }
    }
    
    /**
     * Sets array of all "CCCLOSING" element
     */
    public void setCCCLOSINGArray(net.ofx.types.x2003.x04.CreditCardClosing[] ccclosingArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(ccclosingArray, CCCLOSING$4);
        }
    }
    
    /**
     * Sets ith "CCCLOSING" element
     */
    public void setCCCLOSINGArray(int i, net.ofx.types.x2003.x04.CreditCardClosing ccclosing)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.CreditCardClosing target = null;
            target = (net.ofx.types.x2003.x04.CreditCardClosing)get_store().find_element_user(CCCLOSING$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(ccclosing);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "CCCLOSING" element
     */
    public net.ofx.types.x2003.x04.CreditCardClosing insertNewCCCLOSING(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.CreditCardClosing target = null;
            target = (net.ofx.types.x2003.x04.CreditCardClosing)get_store().insert_element_user(CCCLOSING$4, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "CCCLOSING" element
     */
    public net.ofx.types.x2003.x04.CreditCardClosing addNewCCCLOSING()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.CreditCardClosing target = null;
            target = (net.ofx.types.x2003.x04.CreditCardClosing)get_store().add_element_user(CCCLOSING$4);
            return target;
        }
    }
    
    /**
     * Removes the ith "CCCLOSING" element
     */
    public void removeCCCLOSING(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(CCCLOSING$4, i);
        }
    }
}
